package org.leaf.green.b2b

class StockInOutDetail {

    String serialNumber
    StockOutDetail stockOutDetail
    StockInDetail stockInDetail
    BigDecimal quantity

    static belongsTo = [stockOutDetail : StockOutDetail]

    static constraints = {
        serialNumber(nullable:false, blank:false, unique : 'stockOutDetail', maxSize : 3)
        stockOutDetail(nullable:false)
        stockInDetail(nullable:false)
        quantity(nullable:false, min : new BigDecimal(0))
    }

    String toString(){
        return "$serialNumber"
    }

    static mapping(){
        table 'B2B_STOCK_IN_OUT_DETAIL'
    }
}
